#include <srts/stratego.h>
#include <stratego-lib/stratego-lib.h>
void init_constructors (void)
{
}
static Symbol sym__3;
static Symbol sym__2;
static Symbol sym_Nil_0;
static Symbol sym_StringLit_1;
static Symbol sym_Declaration2_2;
static Symbol sym_Id_1;
static Symbol sym_IdDecl_3;
static Symbol sym_FunDef_3;
static Symbol sym_Compound_2;
static Symbol sym_ArrayInit_1;
static Symbol sym_AssignInit_1;
static Symbol sym_Cons_2;
static Symbol sym_CodeConst_1;
static void init_module_constructors (void)
{
sym__3 = ATmakeSymbol("", 3, ATfalse);
ATprotectSymbol(sym__3);
sym__2 = ATmakeSymbol("", 2, ATfalse);
ATprotectSymbol(sym__2);
sym_Nil_0 = ATmakeSymbol("Nil", 0, ATfalse);
ATprotectSymbol(sym_Nil_0);
sym_StringLit_1 = ATmakeSymbol("StringLit", 1, ATfalse);
ATprotectSymbol(sym_StringLit_1);
sym_Declaration2_2 = ATmakeSymbol("Declaration2", 2, ATfalse);
ATprotectSymbol(sym_Declaration2_2);
sym_Id_1 = ATmakeSymbol("Id", 1, ATfalse);
ATprotectSymbol(sym_Id_1);
sym_IdDecl_3 = ATmakeSymbol("IdDecl", 3, ATfalse);
ATprotectSymbol(sym_IdDecl_3);
sym_FunDef_3 = ATmakeSymbol("FunDef", 3, ATfalse);
ATprotectSymbol(sym_FunDef_3);
sym_Compound_2 = ATmakeSymbol("Compound", 2, ATfalse);
ATprotectSymbol(sym_Compound_2);
sym_ArrayInit_1 = ATmakeSymbol("ArrayInit", 1, ATfalse);
ATprotectSymbol(sym_ArrayInit_1);
sym_AssignInit_1 = ATmakeSymbol("AssignInit", 1, ATfalse);
ATprotectSymbol(sym_AssignInit_1);
sym_Cons_2 = ATmakeSymbol("Cons", 2, ATfalse);
ATprotectSymbol(sym_Cons_2);
sym_CodeConst_1 = ATmakeSymbol("CodeConst", 1, ATfalse);
ATprotectSymbol(sym_CodeConst_1);
}
static ATerm term21;
static ATerm term20;
static ATerm term19;
static ATerm term18;
static ATerm term17;
static ATerm term16;
static ATerm term15;
static ATerm term14;
static ATerm term13;
static ATerm term12;
static ATerm term11;
static ATerm term10;
static ATerm term9;
static ATerm term8;
static ATerm term7;
static ATerm term6;
static ATerm term5;
static ATerm term4;
static ATerm term3;
static ATerm term2;
static ATerm term1;
static ATerm term0;
static void init_module_constant_terms (void)
{
ATprotect(&(term0));
term0 = (ATerm) ATmakeInt(1);
ATprotect(&(term1));
term1 = term0;
ATprotect(&(term2));
term2 = (ATerm) ATmakeAppl(ATmakeSymbol("global", 0, ATtrue));
ATprotect(&(term3));
term3 = term2;
ATprotect(&(term4));
term4 = (ATerm) ATmakeAppl(ATmakeSymbol("symbols", 0, ATtrue));
ATprotect(&(term5));
term5 = term4;
ATprotect(&(term6));
term6 = (ATerm) ATmakeAppl(sym__3, term3, term5, (ATerm) ATempty);
ATprotect(&(term7));
term7 = term6;
ATprotect(&(term8));
term8 = (ATerm) ATmakeAppl(ATmakeSymbol("unique", 0, ATtrue));
ATprotect(&(term9));
term9 = term8;
ATprotect(&(term10));
term10 = (ATerm) ATmakeAppl(ATmakeSymbol("STACK BOTTOM", 0, ATtrue));
ATprotect(&(term11));
term11 = term10;
ATprotect(&(term12));
term12 = (ATerm) ATmakeAppl(sym__2, term3, term5);
ATprotect(&(term13));
term13 = term12;
ATprotect(&(term14));
term14 = (ATerm) ATmakeAppl(ATmakeSymbol("STACK FRAME", 0, ATtrue));
ATprotect(&(term15));
term15 = term14;
ATprotect(&(term16));
term16 = (ATerm) ATmakeAppl(sym__2, term3, term9);
ATprotect(&(term17));
term17 = term16;
ATprotect(&(term18));
term18 = (ATerm) ATmakeInt(42);
ATprotect(&(term19));
term19 = term18;
ATprotect(&(term20));
term20 = (ATerm) ATmakeInt(95);
ATprotect(&(term21));
term21 = term20;
}
#include <srts/init-stratego-application.h>
extern const char * __tracing_table [];
extern unsigned short __tracing_table_counter;
ATerm table_get_0_0 (StrSL sl, ATerm t);
ATerm table_put_0_0 (StrSL sl, ATerm t);
ATerm table_create_0_0 (StrSL sl, ATerm t);
ATerm drop_1_0 (StrSL sl, StrCL l_89, ATerm t);
ATerm init_0_0 (StrSL sl, ATerm t);
ATerm split_fetch_1_0 (StrSL sl, StrCL i_86, ATerm t);
ATerm fetch_elem_1_0 (StrSL sl, StrCL h_86, ATerm t);
ATerm map_1_0 (StrSL sl, StrCL p_85, ATerm t);
ATerm Hd_0_0 (StrSL sl, ATerm t);
ATerm Snd_0_0 (StrSL sl, ATerm t);
ATerm try_1_0 (StrSL sl, StrCL z_60, ATerm t);
ATerm alltd_1_0 (StrSL sl, StrCL v_54, ATerm t);
ATerm strcat_0_0 (StrSL sl, ATerm t);
ATerm explode_string_0_0 (StrSL sl, ATerm t);
ATerm implode_string_0_0 (StrSL sl, ATerm t);
ATerm newname_0_0 (StrSL sl, ATerm t);
ATerm io_wrap_1_0 (StrSL sl, StrCL q_44, ATerm t);
static ATerm lifted22 (StrSL sl, ATerm t);
static ATerm lifted20 (StrSL sl, ATerm t);
static ATerm lifted18 (StrSL sl, ATerm t);
static ATerm lifted17 (StrSL sl, ATerm t);
static ATerm lifted16 (StrSL sl, ATerm t);
static ATerm lifted15 (StrSL sl, ATerm t);
static ATerm lifted14 (StrSL sl, ATerm t);
static ATerm lifted13 (StrSL sl, ATerm t);
ATerm ScrambleVariables_0_0 (StrSL sl, ATerm t);
static ATerm lifted12 (StrSL sl, ATerm t);
static ATerm lifted11 (StrSL sl, ATerm t);
static ATerm lifted10 (StrSL sl, ATerm t);
static ATerm lifted9 (StrSL sl, ATerm t);
ATerm declare_symbol_0_0 (StrSL sl, ATerm t);
static ATerm lifted8 (StrSL sl, ATerm t);
static ATerm lifted7 (StrSL sl, ATerm t);
ATerm replace_2_0 (StrSL sl, StrCL h_19, StrCL i_19, ATerm t);
static ATerm lifted6 (StrSL sl, ATerm t);
static ATerm lifted5 (StrSL sl, ATerm t);
ATerm pop_frame_0_0 (StrSL sl, ATerm t);
ATerm push_frame_0_0 (StrSL sl, ATerm t);
ATerm put_symbol_0_0 (StrSL sl, ATerm t);
static ATerm lifted2 (StrSL sl, ATerm t);
static ATerm lifted1 (StrSL sl, ATerm t);
ATerm scramblevariables_0_0 (StrSL sl, ATerm t);
ATerm main_0_0 (StrSL sl, ATerm t);
ATerm ScrambleVariables_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "ScrambleVariables_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
sl_vars(1);
{
ATerm trm5 = t;
ATerm h_20 = NULL,i_20 = NULL,j_20 = NULL,c_168 = NULL;
sl_init_var(0, c_168);
if(match_cons(t, sym_Id_1))
{
h_20 = ATgetArgument(t, 0);
}
else
goto label3 ;
j_20 = t;
t = h_20;
{
struct str_closure r_168 = { &(lifted13) , &(frame) };
StrCL lifted13_cl = &(r_168);
if((c_168 == NULL))
{
c_168 = t;
}
else
if((c_168 != t))
goto label3 ;
t = term13;
t = table_get_0_0(sl, t);
if((t == NULL))
goto label3 ;
t = fetch_elem_1_0(sl, lifted13_cl, t);
if((t == NULL))
goto label3 ;
if(match_cons(t, sym__2))
{
ATerm trm7 = ATgetArgument(t, 0);
i_20 = ATgetArgument(t, 1);
}
else
goto label3 ;
t = j_20;
t = (ATerm) ATmakeAppl(sym_Id_1, i_20);
}
goto label2 ;
label3 :
t = trm5;
{
ATerm trm8 = t;
ATerm z_19 = NULL,a_20 = NULL,b_20 = NULL,c_20 = NULL,d_20 = NULL,e_20 = NULL,f_20 = NULL,g_20 = NULL;
a_20 = t;
if(match_cons(t, sym_Declaration2_2))
{
ATerm trm9 = ATgetArgument(t, 0);
ATerm trm10 = ATgetArgument(t, 1);
if(((ATgetType(trm10) == AT_LIST) && !(ATisEmpty(trm10))))
{
ATerm trm11 = ATgetFirst((ATermList) trm10);
if(match_cons(trm11, sym_IdDecl_3))
{
ATerm trm12 = ATgetArgument(trm11, 0);
ATerm trm13 = ATgetArgument(trm11, 1);
if(match_cons(trm13, sym_Id_1))
{
z_19 = ATgetArgument(trm13, 0);
}
else
goto label4 ;
{
ATerm trm14 = ATgetArgument(trm11, 2);
}
}
else
goto label4 ;
{
ATerm trm15 = (ATerm) ATgetNext((ATermList) trm10);
if(!(((ATgetType(trm15) == AT_LIST) && ATisEmpty(trm15))))
goto label4 ;
}
}
else
goto label4 ;
}
else
goto label4 ;
c_20 = t;
e_20 = t;
t = term17;
t = table_get_0_0(sl, t);
if((t == NULL))
goto label4 ;
g_20 = t;
f_20 = t;
t = (ATerm) ATmakeAppl(sym__2, f_20, z_19);
t = strcat_0_0(sl, t);
if((t == NULL))
goto label4 ;
{
struct str_closure s_168 = { &(lifted14) , &(frame) };
StrCL lifted14_cl = &(s_168);
struct str_closure t_168 = { &(lifted15) , &(frame) };
StrCL lifted15_cl = &(t_168);
t = replace_2_0(sl, lifted14_cl, lifted15_cl, t);
if((t == NULL))
goto label4 ;
t = newname_0_0(sl, t);
if((t == NULL))
goto label4 ;
{
struct str_closure u_168 = { &(lifted16) , &(frame) };
StrCL lifted16_cl = &(u_168);
struct str_closure v_168 = { &(lifted17) , &(frame) };
StrCL lifted17_cl = &(v_168);
t = replace_2_0(sl, lifted16_cl, lifted17_cl, t);
if((t == NULL))
goto label4 ;
d_20 = t;
t = e_20;
t = (ATerm) ATmakeAppl(sym__2, z_19, d_20);
t = put_symbol_0_0(sl, t);
if((t == NULL))
goto label4 ;
t = a_20;
{
struct str_closure x_168 = { &(lifted18) , &(frame) };
StrCL lifted18_cl = &(x_168);
t = SRTS_all(sl, lifted18_cl, t);
if((t == NULL))
goto label4 ;
b_20 = t;
t = c_20;
t = b_20;
}
}
}
goto label2 ;
label4 :
t = trm8;
{
ATerm trm16 = t;
ATerm r_19 = NULL,s_19 = NULL,t_19 = NULL,u_19 = NULL,v_19 = NULL,w_19 = NULL,x_19 = NULL,y_19 = NULL;
s_19 = t;
if(match_cons(t, sym_FunDef_3))
{
ATerm trm17 = ATgetArgument(t, 0);
ATerm trm18 = ATgetArgument(t, 1);
if(match_cons(trm18, sym_IdDecl_3))
{
ATerm trm19 = ATgetArgument(trm18, 0);
ATerm trm20 = ATgetArgument(trm18, 1);
if(match_cons(trm20, sym_Id_1))
{
r_19 = ATgetArgument(trm20, 0);
}
else
goto label5 ;
{
ATerm trm21 = ATgetArgument(trm18, 2);
}
}
else
goto label5 ;
{
ATerm trm22 = ATgetArgument(t, 2);
}
}
else
goto label5 ;
u_19 = t;
w_19 = t;
t = term17;
t = table_get_0_0(sl, t);
if((t == NULL))
goto label5 ;
y_19 = t;
x_19 = t;
t = (ATerm) ATmakeAppl(sym__2, x_19, r_19);
t = strcat_0_0(sl, t);
if((t == NULL))
goto label5 ;
t = newname_0_0(sl, t);
if((t == NULL))
goto label5 ;
v_19 = t;
t = w_19;
t = (ATerm) ATmakeAppl(sym__2, r_19, v_19);
t = put_symbol_0_0(sl, t);
if((t == NULL))
goto label5 ;
t = s_19;
{
struct str_closure z_168 = { &(lifted20) , &(frame) };
StrCL lifted20_cl = &(z_168);
t = SRTS_all(sl, lifted20_cl, t);
if((t == NULL))
goto label5 ;
t_19 = t;
t = u_19;
t = t_19;
}
goto label2 ;
label5 :
t = trm16;
{
ATerm o_19 = NULL,p_19 = NULL,q_19 = NULL;
o_19 = t;
if(match_cons(t, sym_Compound_2))
{
ATerm trm23 = ATgetArgument(t, 0);
ATerm trm24 = ATgetArgument(t, 1);
}
else
goto fail17 ;
q_19 = t;
t = push_frame_0_0(sl, t);
if((t == NULL))
goto fail17 ;
t = o_19;
{
struct str_closure b_169 = { &(lifted22) , &(frame) };
StrCL lifted22_cl = &(b_169);
t = SRTS_all(sl, lifted22_cl, t);
if((t == NULL))
goto fail17 ;
p_19 = t;
t = pop_frame_0_0(sl, t);
if((t == NULL))
goto fail17 ;
t = q_19;
t = p_19;
goto label2 ;
}
}
}
}
label2 :
;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail17 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted22 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted22";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure a_169 = { &(ScrambleVariables_0_0) , sl_up(sl) };
StrCL lifted23_cl = &(a_169);
t = alltd_1_0(sl_up(sl), lifted23_cl, t);
if((t == NULL))
goto fail25 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail25 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted20 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted20";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure y_168 = { &(ScrambleVariables_0_0) , sl_up(sl) };
StrCL lifted21_cl = &(y_168);
t = alltd_1_0(sl_up(sl), lifted21_cl, t);
if((t == NULL))
goto fail24 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail24 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted18 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted18";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure w_168 = { &(ScrambleVariables_0_0) , sl_up(sl) };
StrCL lifted19_cl = &(w_168);
t = alltd_1_0(sl_up(sl), lifted19_cl, t);
if((t == NULL))
goto fail23 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail23 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted17 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted17";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
t = term21;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail22 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted16 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted16";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
if(!(((ATgetType(t) == AT_INT) && (ATgetInt((ATermInt) t) == 42))))
goto fail21 ;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail21 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted15 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted15";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
t = term19;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail20 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted14 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted14";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
if(!(((ATgetType(t) == AT_INT) && (ATgetInt((ATermInt) t) == 95))))
goto fail19 ;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail19 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted13 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted13";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
if(match_cons(t, sym__2))
{
if((sl_readvar(0, sl) == NULL))
{
sl_readvar(0, sl) = ATgetArgument(t, 0);
}
else
if((sl_readvar(0, sl) != ATgetArgument(t, 0)))
goto fail18 ;
{
ATerm trm6 = ATgetArgument(t, 1);
}
}
else
goto fail18 ;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail18 :
--__tracing_table_counter;
return(NULL);
}
ATerm declare_symbol_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "declare_symbol_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm j_19 = NULL,k_19 = NULL,l_19 = NULL,m_19 = NULL,n_19 = NULL;
if(match_cons(t, sym_Id_1))
{
j_19 = ATgetArgument(t, 0);
}
else
goto fail12 ;
l_19 = t;
t = term17;
t = table_get_0_0(sl, t);
if((t == NULL))
goto fail12 ;
n_19 = t;
m_19 = t;
t = (ATerm) ATmakeAppl(sym__2, m_19, j_19);
t = strcat_0_0(sl, t);
if((t == NULL))
goto fail12 ;
{
struct str_closure n_168 = { &(lifted9) , &(frame) };
StrCL lifted9_cl = &(n_168);
struct str_closure o_168 = { &(lifted10) , &(frame) };
StrCL lifted10_cl = &(o_168);
t = replace_2_0(sl, lifted9_cl, lifted10_cl, t);
if((t == NULL))
goto fail12 ;
t = newname_0_0(sl, t);
if((t == NULL))
goto fail12 ;
{
struct str_closure p_168 = { &(lifted11) , &(frame) };
StrCL lifted11_cl = &(p_168);
struct str_closure q_168 = { &(lifted12) , &(frame) };
StrCL lifted12_cl = &(q_168);
t = replace_2_0(sl, lifted11_cl, lifted12_cl, t);
if((t == NULL))
goto fail12 ;
k_19 = t;
t = l_19;
t = (ATerm) ATmakeAppl(sym__2, j_19, k_19);
t = put_symbol_0_0(sl, t);
if((t == NULL))
goto fail12 ;
}
}
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail12 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted12 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted12";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
t = term21;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail16 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted11 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted11";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
if(!(((ATgetType(t) == AT_INT) && (ATgetInt((ATermInt) t) == 42))))
goto fail15 ;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail15 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted10 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted10";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
t = term19;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail14 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted9 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted9";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
if(!(((ATgetType(t) == AT_INT) && (ATgetInt((ATermInt) t) == 95))))
goto fail13 ;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail13 :
--__tracing_table_counter;
return(NULL);
}
ATerm replace_2_0 (StrSL sl, StrCL h_19, StrCL i_19, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "replace_2_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
sl_funs(2);
sl_init_fun(0, h_19);
sl_init_fun(1, i_19);
t = explode_string_0_0(sl, t);
if((t == NULL))
goto fail9 ;
{
struct str_closure m_168 = { &(lifted7) , &(frame) };
StrCL lifted7_cl = &(m_168);
t = map_1_0(sl, lifted7_cl, t);
if((t == NULL))
goto fail9 ;
t = implode_string_0_0(sl, t);
if((t == NULL))
goto fail9 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail9 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted7 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted7";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure l_168 = { &(lifted8) , &(frame) };
StrCL lifted8_cl = &(l_168);
t = try_1_0(sl_up(sl), lifted8_cl, t);
if((t == NULL))
goto fail10 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail10 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted8 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted8";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
t = sl_fun(0, sl_up(sl))(sl_fun_sl(0, sl_up(sl)), t);
if((t == NULL))
goto fail11 ;
t = sl_fun(1, sl_up(sl))(sl_fun_sl(1, sl_up(sl)), t);
if((t == NULL))
goto fail11 ;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail11 :
--__tracing_table_counter;
return(NULL);
}
ATerm pop_frame_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "pop_frame_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure k_168 = { &(lifted5) , &(frame) };
StrCL lifted5_cl = &(k_168);
t = term13;
t = table_get_0_0(sl, t);
if((t == NULL))
goto fail6 ;
t = try_1_0(sl, lifted5_cl, t);
if((t == NULL))
goto fail6 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail6 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted5 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted5";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm f_19 = NULL,g_19 = NULL;
struct str_closure j_168 = { &(lifted6) , &(frame) };
StrCL lifted6_cl = &(j_168);
t = split_fetch_1_0(sl_up(sl), lifted6_cl, t);
if((t == NULL))
goto fail7 ;
g_19 = t;
t = Snd_0_0(sl_up(sl), t);
if((t == NULL))
goto fail7 ;
f_19 = t;
t = g_19;
t = (ATerm) ATmakeAppl(sym__3, term3, term5, f_19);
t = table_put_0_0(sl_up(sl), t);
if((t == NULL))
goto fail7 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail7 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted6 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted6";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
if(!((ATgetSymbol(t) == ATmakeSymbol("STACK FRAME", 0, ATtrue))))
goto fail8 ;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail8 :
--__tracing_table_counter;
return(NULL);
}
ATerm push_frame_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "push_frame_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
t = term13;
t = table_get_0_0(sl, t);
if((t == NULL))
goto fail5 ;
t = Hd_0_0(sl, t);
if((t == NULL))
goto fail5 ;
{
ATerm trm4 = t;
if(!((ATgetSymbol(t) == ATmakeSymbol("STACK BOTTOM", 0, ATtrue))))
goto label1 ;
goto label0 ;
label1 :
t = trm4;
t = term15;
t = put_symbol_0_0(sl, t);
if((t == NULL))
goto fail5 ;
else
goto label0 ;
label0 :
;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail5 :
--__tracing_table_counter;
return(NULL);
}
ATerm put_symbol_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "put_symbol_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm c_19 = NULL,d_19 = NULL,e_19 = NULL;
c_19 = t;
t = term13;
t = table_get_0_0(sl, t);
if((t == NULL))
goto fail4 ;
e_19 = t;
d_19 = t;
{
ATerm trm3;
trm3 = CheckATermList(d_19);
if((trm3 == NULL))
goto fail4 ;
t = (ATerm) ATmakeAppl(sym__3, term3, term5, (ATerm) ATinsert((ATermList)trm3, c_19));
t = table_put_0_0(sl, t);
if((t == NULL))
goto fail4 ;
}
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail4 :
--__tracing_table_counter;
return(NULL);
}
ATerm scramblevariables_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "scramblevariables_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm w_18 = NULL,x_18 = NULL,y_18 = NULL,z_18 = NULL,a_19 = NULL,y_167 = NULL;
struct str_closure e_168 = { &(ScrambleVariables_0_0) , sl };
StrCL lifted4_cl = &(e_168);
if(match_cons(t, sym__3))
{
z_18 = ATgetArgument(t, 0);
w_18 = ATgetArgument(t, 1);
y_18 = ATgetArgument(t, 2);
}
else
goto fail1 ;
t = w_18;
if(match_cons(t, sym_StringLit_1))
{
ATerm trm0 = ATgetArgument(t, 0);
if(((ATgetType(trm0) == AT_LIST) && !(ATisEmpty(trm0))))
{
a_19 = ATgetFirst((ATermList) trm0);
{
ATerm trm1 = (ATerm) ATgetNext((ATermList) trm0);
if(!(((ATgetType(trm1) == AT_LIST) && ATisEmpty(trm1))))
goto fail1 ;
}
}
else
goto fail1 ;
}
else
goto fail1 ;
t = a_19;
t = explode_string_0_0(sl, t);
if((t == NULL))
goto fail1 ;
t = init_0_0(sl, t);
if((t == NULL))
goto fail1 ;
{
struct str_closure f_168 = { &(lifted1) , &(frame) };
StrCL lifted1_cl = &(f_168);
t = drop_1_0(sl, lifted1_cl, t);
if((t == NULL))
goto fail1 ;
t = implode_string_0_0(sl, t);
if((t == NULL))
goto fail1 ;
x_18 = t;
t = term3;
t = table_create_0_0(sl, t);
if((t == NULL))
goto fail1 ;
t = term7;
t = table_put_0_0(sl, t);
if((t == NULL))
goto fail1 ;
t = (ATerm) ATmakeAppl(sym__3, term3, term9, x_18);
t = table_put_0_0(sl, t);
if((t == NULL))
goto fail1 ;
t = y_18;
{
struct str_closure g_168 = { &(lifted2) , &(frame) };
StrCL lifted2_cl = &(g_168);
if(match_cons(t, sym_ArrayInit_1))
{
y_167 = ATgetArgument(t, 0);
}
else
goto fail1 ;
t = y_167;
t = map_1_0(sl, lifted2_cl, t);
if((t == NULL))
goto fail1 ;
{
struct str_closure h_168 = { &(declare_symbol_0_0) , sl };
StrCL lifted3_cl = &(h_168);
t = map_1_0(sl, lifted3_cl, t);
if((t == NULL))
goto fail1 ;
t = term11;
t = put_symbol_0_0(sl, t);
if((t == NULL))
goto fail1 ;
t = z_18;
t = alltd_1_0(sl, lifted4_cl, t);
if((t == NULL))
goto fail1 ;
}
}
}
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail1 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted2 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted2";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
ATerm b_168 = NULL;
if(match_cons(t, sym_AssignInit_1))
{
ATerm trm2 = ATgetArgument(t, 0);
if(match_cons(trm2, sym_CodeConst_1))
{
b_168 = ATgetArgument(trm2, 0);
}
else
goto fail3 ;
}
else
goto fail3 ;
t = b_168;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail3 :
--__tracing_table_counter;
return(NULL);
}
static ATerm lifted1 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "lifted1";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
t = term1;
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail2 :
--__tracing_table_counter;
return(NULL);
}
ATerm main_0_0 (StrSL sl, ATerm t)
{
__tracing_table[__tracing_table_counter++] = "main_0_0";
__tracing_table[__tracing_table_counter] = NULL;
sl_decl(sl);
{
struct str_closure d_168 = { &(scramblevariables_0_0) , sl };
StrCL lifted0_cl = &(d_168);
t = io_wrap_1_0(sl, lifted0_cl, t);
if((t == NULL))
goto fail0 ;
}
__tracing_table[--__tracing_table_counter] = NULL;
return(t);
fail0 :
--__tracing_table_counter;
return(NULL);
}
static void register_strategies (void)
{
int initial_size = 117;
int max_load = 75;
struct str_closure * closures;
int closures_index = 0;
if((strategy_table == NULL))
strategy_table = ATtableCreate(initial_size, max_load);
closures = (struct str_closure*) malloc((sizeof(struct str_closure) * 43));
if((closures == NULL))
{
perror("malloc error for registration of dynamic strategies");
exit(1);
}
closures[closures_index].fun = &(table_get_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("table_get_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(table_put_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("table_put_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(table_create_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("table_create_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(drop_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("drop_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(init_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("init_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(split_fetch_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("split_fetch_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(fetch_elem_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("fetch_elem_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(map_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("map_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(Hd_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("Hd_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(Snd_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("Snd_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(try_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("try_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(alltd_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("alltd_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(strcat_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("strcat_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(explode_string_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("explode_string_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(implode_string_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("implode_string_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(newname_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("newname_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(io_wrap_1_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("io_wrap_1_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted22);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted22", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted20);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted20", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted18);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted18", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted17);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted17", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted16);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted16", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted15);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted15", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted14);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted14", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted13);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted13", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(ScrambleVariables_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("ScrambleVariables_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted12);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted12", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted11);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted11", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted10);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted10", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted9);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted9", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(declare_symbol_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("declare_symbol_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted8);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted8", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted7);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted7", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(replace_2_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("replace_2_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted6);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted6", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted5);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted5", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(pop_frame_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("pop_frame_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(push_frame_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("push_frame_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(put_symbol_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("put_symbol_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted2);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted2", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(lifted1);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("lifted1", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(scramblevariables_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("scramblevariables_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
closures[closures_index].fun = &(main_0_0);
closures[closures_index].sl = NULL;
SRTS_register_function((ATerm)ATmakeAppl0(ATmakeSymbol("main_0_0", 0, ATtrue)), &(closures[closures_index]));
closures_index++;
}
int main (int argc, char * argv [])
{
ATerm out_term;
ATermList in_term;
int i;
ATinit(argc, argv, &(out_term));
init_constructors();
in_term = ATempty;
for ( i = (argc - 1) ; (i >= 0) ; i-- )
{
in_term = ATinsert(in_term, (ATerm) ATmakeAppl0(ATmakeSymbol(argv[i], 0, ATtrue)));
}
SRTS_stratego_initialize();
memset(__tracing_table, 0, (sizeof(unsigned short) * TRACING_TABLE_SIZE));
__tracing_table_counter = 0;
register_strategies();
out_term = main_0_0(NULL, (ATerm) in_term);
if((out_term != NULL))
{
ATfprintf(stdout, "%t\n", out_term);
exit(0);
}
else
{
ATfprintf(stderr, "%s: rewriting failed, trace:\n", argv[0]);
for ( i = 0 ; (__tracing_table[i] && (i < TRACING_TABLE_SIZE)) ; i++ )
ATfprintf(stderr, "\t%s\n", __tracing_table[i]);
exit(1);
}
}
